package com.yudaob2b.common.utils;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * @author Kidd.Tan
 * @email 298023780@qq.com
 * @date 7/11/18 11:44 PM
 */
public class ExceptionUtil {

    public static String getTrace(Throwable t) {
        StringWriter stringWriter = new StringWriter();
        PrintWriter writer = new PrintWriter(stringWriter);
        t.printStackTrace(writer);
        StringBuffer buffer = stringWriter.getBuffer();
        return buffer.toString();
    }
}
